home *** CD-ROM | disk | FTP | other *** search
/ Clickx 47 / Clickx 47.iso / assets / software / switchproxy.xpi / chrome / switchproxy.jar / content / dialogs / editcommon.js < prev    next >
Encoding:
JavaScript  |  2006-04-11  |  474 b   |  17 lines

  1. //Has Special Chars
  2. //  + returns true if it only
  3. //  + contains allowed chars
  4. function switchproxy_allowedChars(str){
  5.   var regex = new RegExp("[\\s\\.a-zA-Z0-9_]", "g");
  6.   return regex.test(str);
  7. }
  8.  
  9. // Used to test strings
  10. //  + converts space to underscore
  11. //  + and converts to lowercase
  12. function switchproxy_simplify(str){
  13.   str = str.replace(new RegExp("\\s{2,}", "g"), " ");
  14.   str = str.replace(new RegExp("\\s", "g"), "_");
  15.   str = str.toLowerCase();
  16.   return str;
  17. }